"""
购物车相关的序列化器集
"""
from rest_framework import serializers
from cart.models import Cart

from goods.serializers import GoodsSerializer


class CartSerializer(serializers.ModelSerializer):
    """ 写入购物车的信息 """

    class Meta:
        model = Cart
        fields = '__all__'


class ReadCartSerializer(serializers.ModelSerializer):
    """ 读取购物车的信息 """

    goods = GoodsSerializer()

    class Meta:
        model = Cart
        fields = '__all__'
